package com.zcah.sensitive.controller;

import com.zcah.sensitive.entity.ComprehensiveInformation;
import com.zcah.sensitive.service.SenInfoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
public class IndexController {


    @Autowired
    private SenInfoServiceImpl senInfoServiceImpl;


    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String demo() {
        return "index";
    }

//    @RequestMapping(value = "/getDate/{date}", method = RequestMethod.GET)
//    @ResponseBody
//    public Map<String, Object> getDate(@PathVariable Long date) {
//        return senInfoServiceImpl.getDate(date);
//    }

    @ResponseBody
    @RequestMapping(value = "/getInfo/{date}", method = RequestMethod.GET)
    public ComprehensiveInformation getInfo(@PathVariable String date) {
        return senInfoServiceImpl.getInfo(date);
    }
}
